home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Collections: Franz PD
/
Franz PD Disk #279 (1993)(Rhein-Sieg-Soft).zip
/
Franz PD Disk #279 (1993)(Rhein-Sieg-Soft).adf
/
ak_gen0-lib_V38.20.LHA
/
ak_gen0-library
/
Programmers.LHA
/
Programmers
/
Examples
/
ExtFileReq.c
< prev
next >
Wrap
C/C++ Source or Header
|
1993-06-26
|
2KB
|
68 lines
/* ExtFileReq V37.83 */
/* FREEWARE. */
/* (c) 1992-93 by Andreas R. Kleinert. */
/* Demonstrates use of the "ak_gen0.library"'s FileRequester. */
/* (using the extended Requester-Functions of V37+) */
/* Also opening of windows is demonstrated. */
/* Written in SAS/C V6.00 for OS V2.04 (V37) Includes. */
#include <ak_gen0/ak_gen0_pragma.h>
#include <stdlib.h>
#include <proto/exec.h>
#include <proto/intuition.h>
void main(long argc, char **argv) /* MAIN */
{
struct Window *tst_win = N;
char *fptr = N;
IntuitionBase = (struct IntuitionBase *) OpenLibrary("intuition.library", 0);
/* will always be open because of version==0 */
printf("\nExtFileReq V37.83, FREEWARE, (c) 1992-93 by Andreas R. Kleinert.\n");
AKBase = (struct AKBase *) OpenLibrary("ak_gen0.library", 37); /* minimum */
if(AKBase)
{
tst_win = AK_Window( 0, 0, 640, 256, 1, 2, N, (ACTIVATE|WINDOWSIZING|NOCAREREFRESH|SIMPLE_REFRESH), N, N, "Test-Window", N, N, 640, 256, 640, 256, WBENCHSCREEN);
if(tst_win)
{
struct AK_Requester *ak_req = N;
ak_req = AK_AllocRequester(AK_REQTYPE_FILE); /* Allocate Requester */
if(ak_req)
{
ak_req->akr_Window = CURRENT_WINDOW; /* optional */
ak_req->akr_OKText = " Load "; /* optional */
ak_req->akr_CancelText = " Quit "; /* optional */
ak_req->akr_LeftEdge = 75; /* optional */
ak_req->akr_TopEdge = 25; /* optional */
ak_req->akr_Default1 = (ULONG) "DemoDir/"; /* optional */
ak_req->akr_Default2 = (ULONG) "DemoFile"; /* optional */
fptr = AK_ExtFileRequest(ak_req);
if(fptr) FreeMem(fptr, AK_FILEREQ_STRING_LEN); /* free string returned by function */
/* may be NULL (check out !) */
AK_FreeRequester(ak_req); /* Free Requester */
}
CloseWindow(tst_win);
}
CloseLibrary((APTR) AKBase);
}else
{
printf("\n Can't open \42ak_gen0.library\42 V37+ !\n");
}
CloseLibrary((APTR) IntuitionBase);
exit(0);
}